//
//  BezierPathView.m
//  DrawingGraphics
//
//  Created by bolaaw on 2018/3/5.
//  Copyright © 2018年 Koharu. All rights reserved.
//

#import "BezierPathView.h"

@implementation BezierPathView


- (void)drawRect:(CGRect)rect {
    
    CGFloat w = self.bounds.size.width - 10;
    CGFloat h = self.bounds.size.height - 10;


//    UIBezierPath *path = [UIBezierPath bezierPath];
    //绘制一个起点为(5,5) 宽高为(w,h)的正方形
//    UIBezierPath *path = [UIBezierPath bezierPathWithRect:CGRectMake(5, 5, 50, h)];
//    UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:(CGRect){5,h/2,w,100}];
    /*
     
     Center:圆弧的中心；
     
     　　  radius:半径；
     
     startAngle:开始角度；
     
     endAngle:结束角度；
     
     clockwise:是否顺时针方向；
     
     */
    
     UIBezierPath * path =[UIBezierPath bezierPathWithArcCenter:CGPointMake(100, 100) radius:90 startAngle:0 endAngle:M_PI/2 clockwise:YES];
//    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(5, 5, w, h) cornerRadius:w/2];
//    UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(5, 5, w, h)];
    

    path.lineWidth = 5;
    path.lineJoinStyle = kCGLineJoinRound;
   

//    // 绘制"\"线条
//    [path moveToPoint:CGPointMake(5, 5)];
//
//    [path addLineToPoint:CGPointMake(w, 5)];
////
//    [path addLineToPoint:CGPointMake(w, h)];
////
//    [path addLineToPoint:CGPointMake(5, h+5)];
//
//    [path closePath];

    UIColor *color = [UIColor redColor];
    [color set];
    [path stroke];
    
 
}




@end
